home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / VideoToolboxSources / WindowToEPS.c < prev    next >
MacBinary  |  1995-03-21  |  11.0 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Tue Mar 21 14:01:27 1995, modified Tue Mar 21 14:01:27 1995, creator 'MMCC', type ASCII, 10615 bytes "WindowToEPS.c" , at 0x29f7 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 57 69 6e 64 6f 77 | 54 6f 45 50 53 2e 63 00 |..Window|ToEPS.c.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 29 77 00 | 00 01 9a ab 94 d3 07 ab |.....)w.|........|
|00000060| 94 d3 07 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 8e 6c 00 00 |........|.....l..|
|00000080| 2f 2a 0d 57 69 6e 64 6f | 77 54 6f 45 50 53 2e 63 |/*.Windo|wToEPS.c|
|00000090| 0d 43 6f 70 79 72 69 67 | 68 74 20 a9 20 31 39 39 |.Copyrig|ht . 199|
|000000a0| 34 2c 31 39 39 35 20 44 | 65 6e 69 73 20 47 2e 20 |4,1995 D|enis G. |
|000000b0| 50 65 6c 6c 69 0d 0d 09 | 0d 57 69 6e 64 6f 77 54 |Pelli...|.WindowT|
|000000c0| 6f 45 50 53 28 77 69 6e | 64 6f 77 2c 66 69 6c 65 |oEPS(win|dow,file|
|000000d0| 6e 61 6d 65 2c 72 65 63 | 74 50 74 72 2c 70 61 67 |name,rec|tPtr,pag|
|000000e0| 65 52 65 63 74 50 74 72 | 2c 63 65 6c 6c 73 50 65 |eRectPtr|,cellsPe|
|000000f0| 72 49 6e 63 68 2c 67 72 | 61 79 4c 65 76 65 6c 73 |rInch,gr|ayLevels|
|00000100| 2c 72 65 66 6c 65 63 74 | 61 6e 63 65 29 3b 0d 0d |,reflect|ance);..|
|00000110| 09 54 68 69 73 20 69 73 | 20 61 20 73 69 6d 70 6c |.This is| a simpl|
|00000120| 65 2c 20 62 75 74 20 72 | 65 61 73 6f 6e 61 62 6c |e, but r|easonabl|
|00000130| 79 20 67 65 6e 65 72 61 | 6c 2c 20 72 6f 75 74 69 |y genera|l, routi|
|00000140| 6e 65 20 74 6f 20 63 6f | 6e 76 65 72 74 20 61 0d |ne to co|nvert a.|
|00000150| 67 72 61 79 73 63 61 6c | 65 20 69 6d 61 67 65 20 |grayscal|e image |
|00000160| 28 69 6e 20 77 69 6e 64 | 6f 77 20 6f 72 20 47 57 |(in wind|ow or GW|
|00000170| 6f 72 6c 64 29 20 74 6f | 20 61 20 50 6f 73 74 53 |orld) to| a PostS|
|00000180| 63 72 69 70 74 20 66 69 | 6c 65 20 74 68 61 74 20 |cript fi|le that |
|00000190| 6d 61 79 20 62 65 0d 74 | 72 61 6e 73 6d 69 74 74 |may be.t|ransmitt|
|000001a0| 65 64 20 74 6f 20 61 20 | 4c 61 73 65 72 57 72 69 |ed to a |LaserWri|
|000001b0| 74 65 72 20 6f 72 20 4c | 69 6e 6f 74 79 70 65 20 |ter or L|inotype |
|000001c0| 74 6f 20 70 72 6f 64 75 | 63 65 20 61 20 68 61 6c |to produ|ce a hal|
|000001d0| 66 74 6f 6e 65 20 69 6d | 61 67 65 20 6f 6e 0d 70 |ftone im|age on.p|
|000001e0| 61 70 65 72 2e 20 57 65 | 20 75 73 65 20 69 74 20 |aper. We| use it |
|000001f0| 61 20 6c 6f 74 2c 20 61 | 6e 64 20 69 74 20 77 6f |a lot, a|nd it wo|
|00000200| 72 6b 73 20 77 65 6c 6c | 2e 0d 09 54 68 65 20 66 |rks well|...The f|
|00000210| 69 6c 65 6e 61 6d 65 2c | 20 62 79 20 63 6f 6e 76 |ilename,| by conv|
|00000220| 65 6e 74 69 6f 6e 2c 20 | 73 68 6f 75 6c 64 20 65 |ention, |should e|
|00000230| 6e 64 20 69 6e 20 22 2e | 65 70 73 22 20 74 6f 20 |nd in ".|eps" to |
|00000240| 69 6e 64 69 63 61 74 65 | 20 74 68 61 74 0d 69 74 |indicate| that.it|
|00000250| 20 69 73 20 61 6e 20 65 | 6e 63 61 70 73 75 6c 61 | is an e|ncapsula|
|00000260| 74 65 64 20 70 6f 73 74 | 73 63 72 69 70 74 20 66 |ted post|script f|
|00000270| 69 6c 65 2c 20 62 75 74 | 20 74 68 69 73 20 69 73 |ile, but| this is|
|00000280| 20 6e 6f 74 20 65 6e 66 | 6f 72 63 65 64 2e 20 54 | not enf|orced. T|
|00000290| 68 65 0d 66 69 6c 65 27 | 73 20 74 79 70 65 20 69 |he.file'|s type i|
|000002a0| 73 20 73 65 74 20 74 6f | 20 27 54 45 58 54 27 20 |s set to| 'TEXT' |
|000002b0| 77 69 74 68 20 63 72 65 | 61 74 6f 72 20 27 45 50 |with cre|ator 'EP|
|000002c0| 53 46 27 2e 20 49 74 27 | 73 20 61 20 70 6c 61 69 |SF'. It'|s a plai|
|000002d0| 6e 20 74 65 78 74 0d 66 | 69 6c 65 2e 0d 09 54 68 |n text.f|ile...Th|
|000002e0| 65 20 50 69 78 4d 61 70 | 20 6d 75 73 74 20 68 61 |e PixMap| must ha|
|000002f0| 76 65 20 38 20 62 69 74 | 73 20 70 65 72 20 70 69 |ve 8 bit|s per pi|
|00000300| 78 65 6c 2e 20 54 68 65 | 20 77 69 6e 64 6f 77 27 |xel. The| window'|
|00000310| 73 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 20 69 73 |s color |table is|
|00000320| 0d 69 67 6e 6f 72 65 64 | 2e 20 54 68 65 20 72 61 |.ignored|. The ra|
|00000330| 77 20 70 69 78 65 6c 20 | 76 61 6c 75 65 20 28 77 |w pixel |value (w|
|00000340| 68 69 63 68 20 41 70 70 | 6c 65 20 63 61 6c 6c 73 |hich App|le calls|
|00000350| 20 61 6e 20 22 69 6e 64 | 65 78 22 29 20 69 73 0d | an "ind|ex") is.|
|00000360| 74 72 61 6e 73 66 6f 72 | 6d 65 64 20 62 79 20 74 |transfor|med by t|
|00000370| 68 65 20 6f 70 74 69 6f | 6e 61 6c 20 72 65 66 6c |he optio|nal refl|
|00000380| 65 63 74 61 6e 63 65 20 | 61 72 72 61 79 20 28 69 |ectance |array (i|
|00000390| 66 20 70 72 65 73 65 6e | 74 29 2c 20 61 6e 64 20 |f presen|t), and |
|000003a0| 74 68 65 6e 0d 73 65 6e | 74 20 64 69 72 65 63 74 |then.sen|t direct|
|000003b0| 6c 79 20 74 6f 20 74 68 | 65 20 70 72 69 6e 74 65 |ly to th|e printe|
|000003c0| 72 2e 20 49 66 20 22 72 | 65 66 6c 65 63 74 61 6e |r. If "r|eflectan|
|000003d0| 63 65 22 20 69 73 20 4e | 55 4c 4c 2c 20 74 68 65 |ce" is N|ULL, the|
|000003e0| 6e 20 74 68 65 20 70 69 | 78 65 6c 0d 76 61 6c 75 |n the pi|xel.valu|
|000003f0| 65 2c 20 66 72 6f 6d 20 | 30 20 74 6f 20 32 35 35 |e, from |0 to 255|
|00000400| 20 69 73 20 69 6e 74 65 | 72 70 72 65 74 65 64 20 | is inte|rpreted |
|00000410| 62 79 20 50 6f 73 74 53 | 63 72 69 70 74 20 61 73 |by PostS|cript as|
|00000420| 20 70 72 6f 70 6f 72 74 | 69 6f 6e 61 6c 20 74 6f | proport|ional to|
|00000430| 0d 64 65 73 69 72 65 64 | 20 72 65 66 6c 65 63 74 |.desired| reflect|
|00000440| 61 6e 63 65 2c 20 66 72 | 6f 6d 20 7a 65 72 6f 20 |ance, fr|om zero |
|00000450| 74 6f 20 31 2e 20 49 66 | 20 79 6f 75 20 73 75 70 |to 1. If| you sup|
|00000460| 70 6c 79 20 61 20 22 72 | 65 66 6c 65 63 74 61 6e |ply a "r|eflectan|
|00000470| 63 65 22 20 61 72 72 61 | 79 0d 74 68 65 20 76 61 |ce" arra|y.the va|
|00000480| 6c 75 65 73 20 73 68 6f | 75 6c 64 20 72 61 6e 67 |lues sho|uld rang|
|00000490| 65 20 66 72 6f 6d 20 30 | 2e 30 20 74 6f 20 31 2e |e from 0|.0 to 1.|
|000004a0| 30 2e 20 54 68 65 20 2a | 72 65 63 74 50 74 72 20 |0. The *|rectPtr |
|000004b0| 69 6e 64 69 63 61 74 65 | 73 20 77 68 61 74 0d 70 |indicate|s what.p|
|000004c0| 61 72 74 20 6f 66 20 79 | 6f 75 72 20 50 69 78 4d |art of y|our PixM|
|000004d0| 61 70 20 69 73 20 74 6f | 20 62 65 20 75 73 65 64 |ap is to| be used|
|000004e0| 2e 0d 09 54 68 65 20 2a | 70 61 67 65 52 65 63 74 |...The *|pageRect|
|000004f0| 50 74 72 20 69 73 20 73 | 75 62 74 6c 65 2e 20 49 |Ptr is s|ubtle. I|
|00000500| 74 20 64 65 73 63 72 69 | 62 65 73 2c 20 69 6e 20 |t descri|bes, in |
|00000510| 74 79 70 6f 67 72 61 70 | 68 65 72 73 20 70 6f 69 |typograp|hers poi|
|00000520| 6e 74 73 0d 28 31 2f 37 | 32 22 29 2c 20 74 68 65 |nts.(1/7|2"), the|
|00000530| 20 72 65 63 74 61 6e 67 | 6c 65 20 74 68 61 74 20 | rectang|le that |
|00000540| 79 6f 75 72 20 69 6d 61 | 67 65 20 77 69 6c 6c 20 |your ima|ge will |
|00000550| 62 65 20 6d 61 70 70 65 | 64 20 6f 6e 74 6f 20 6f |be mappe|d onto o|
|00000560| 6e 20 74 68 65 0d 70 72 | 69 6e 74 65 64 20 70 61 |n the.pr|inted pa|
|00000570| 67 65 2e 20 49 74 20 69 | 73 20 65 73 73 65 6e 74 |ge. It i|s essent|
|00000580| 69 61 6c 20 74 68 61 74 | 20 79 6f 75 20 6b 65 65 |ial that| you kee|
|00000590| 70 20 69 6e 20 6d 69 6e | 64 20 74 68 61 74 20 41 |p in min|d that A|
|000005a0| 70 70 6c 65 20 61 6e 64 | 20 41 64 6f 62 65 0d 75 |pple and| Adobe.u|
|000005b0| 73 65 20 64 69 66 66 65 | 72 65 6e 74 20 63 6f 6f |se diffe|rent coo|
|000005c0| 72 64 69 6e 61 74 65 20 | 73 79 73 74 65 6d 73 2e |rdinate |systems.|
|000005d0| 20 42 6f 74 68 20 41 70 | 70 6c 65 20 61 6e 64 20 | Both Ap|ple and |
|000005e0| 41 64 6f 62 65 20 69 6e | 63 72 65 61 73 65 20 78 |Adobe in|crease x|
|000005f0| 20 66 72 6f 6d 0d 6c 65 | 66 74 20 74 6f 20 72 69 | from.le|ft to ri|
|00000600| 67 68 74 2e 20 48 6f 77 | 65 76 65 72 2c 20 41 70 |ght. How|ever, Ap|
|00000610| 70 6c 65 20 68 61 73 20 | 79 20 69 6e 63 72 65 61 |ple has |y increa|
|00000620| 73 69 6e 67 20 66 72 6f | 6d 20 74 6f 70 20 74 6f |sing fro|m top to|
|00000630| 20 62 6f 74 74 6f 6d 2c | 0d 77 68 65 72 65 61 73 | bottom,|.whereas|
|00000640| 20 41 64 6f 62 65 20 69 | 6e 63 72 65 61 73 65 73 | Adobe i|ncreases|
|00000650| 20 79 20 66 72 6f 6d 20 | 62 6f 74 74 6f 6d 20 74 | y from |bottom t|
|00000660| 6f 20 74 6f 70 2e 20 41 | 64 6f 62 65 27 73 20 6f |o top. A|dobe's o|
|00000670| 72 69 67 69 6e 20 69 73 | 20 74 68 65 0d 6c 6f 77 |rigin is| the.low|
|00000680| 65 72 20 6c 65 66 74 20 | 63 6f 72 6e 65 72 20 6f |er left |corner o|
|00000690| 66 20 74 68 65 20 70 61 | 67 65 2c 20 65 76 65 6e |f the pa|ge, even|
|000006a0| 20 74 68 6f 75 67 68 20 | 74 68 61 74 20 70 6f 69 | though |that poi|
|000006b0| 6e 74 20 69 73 20 75 73 | 75 61 6c 6c 79 20 6e 6f |nt is us|ually no|
|000006c0| 74 0d 70 72 69 6e 74 61 | 62 6c 65 2c 20 73 69 6e |t.printa|ble, sin|
|000006d0| 63 65 20 6d 6f 73 74 20 | 70 72 69 6e 74 65 72 73 |ce most |printers|
|000006e0| 20 63 61 6e 20 6f 6e 6c | 79 20 70 72 69 6e 74 20 | can onl|y print |
|000006f0| 74 6f 20 77 69 74 68 69 | 6e 20 61 62 6f 75 74 20 |to withi|n about |
|00000700| 61 20 68 61 6c 66 0d 69 | 6e 63 68 20 6f 66 20 74 |a half.i|nch of t|
|00000710| 68 65 20 65 64 67 65 2e | 20 54 68 65 20 70 61 67 |he edge.| The pag|
|00000720| 65 52 65 63 74 2c 20 74 | 68 6f 75 67 68 20 73 75 |eRect, t|hough su|
|00000730| 70 70 6c 69 65 64 20 69 | 6e 20 41 70 70 6c 65 27 |pplied i|n Apple'|
|00000740| 73 20 52 65 63 74 20 64 | 61 74 61 0d 73 74 72 75 |s Rect d|ata.stru|
|00000750| 63 74 75 72 65 2c 20 6d | 75 73 74 20 62 65 20 69 |cture, m|ust be i|
|00000760| 6e 20 41 64 6f 62 65 27 | 73 20 63 6f 6f 72 64 69 |n Adobe'|s coordi|
|00000770| 6e 61 74 65 73 2c 20 72 | 65 73 70 65 63 74 69 6e |nates, r|espectin|
|00000780| 67 20 74 68 65 20 6e 61 | 6d 65 73 20 6f 66 20 74 |g the na|mes of t|
|00000790| 68 65 0d 52 65 63 74 20 | 73 74 72 75 63 74 75 72 |he.Rect |structur|
|000007a0| 65 27 73 20 66 69 65 6c | 64 73 3a 20 6c 65 66 74 |e's fiel|ds: left|
|000007b0| 2c 20 74 6f 70 2c 20 72 | 69 67 68 74 2c 20 62 6f |, top, r|ight, bo|
|000007c0| 74 74 6f 6d 2e 20 53 6f | 2c 20 66 6f 72 20 61 6e |ttom. So|, for an|
|000007d0| 20 69 6d 61 67 65 20 74 | 6f 0d 66 69 6c 6c 20 6d | image t|o.fill m|
|000007e0| 6f 73 74 20 6f 66 20 61 | 6e 20 38 2e 35 78 31 31 |ost of a|n 8.5x11|
|000007f0| 20 70 61 67 65 2c 20 77 | 69 74 68 20 30 2e 35 22 | page, w|ith 0.5"|
|00000800| 20 6d 61 72 67 69 6e 73 | 2c 20 79 6f 75 20 6d 69 | margins|, you mi|
|00000810| 67 68 74 20 75 73 65 20 | 74 68 65 0d 66 6f 6c 6c |ght use |the.foll|
|00000820| 6f 77 69 6e 67 3a 0d 0d | 09 09 53 65 74 52 65 63 |owing:..|..SetRec|
|00000830| 74 28 26 70 61 67 65 52 | 65 63 74 2c 30 2e 35 2a |t(&pageR|ect,0.5*|
|00000840| 37 32 2c 31 30 2e 35 2a | 37 32 2c 38 2a 37 32 2c |72,10.5*|72,8*72,|
|00000850| 30 2e 35 2a 37 32 29 3b | 0d 0d 09 49 6e 20 70 72 |0.5*72);|...In pr|
|00000860| 69 6e 74 69 6e 67 20 50 | 6f 73 74 53 63 72 69 70 |inting P|ostScrip|
|00000870| 74 20 68 61 6c 66 74 6f | 6e 65 73 20 74 68 65 20 |t halfto|nes the |
|00000880| 68 61 6c 66 74 6f 6e 65 | 20 63 65 6c 6c 20 73 69 |halftone| cell si|
|00000890| 7a 65 20 64 65 74 65 72 | 6d 69 6e 65 73 0d 62 6f |ze deter|mines.bo|
|000008a0| 74 68 20 74 68 65 20 73 | 70 61 74 69 61 6c 20 61 |th the s|patial a|
|000008b0| 6e 64 20 67 72 61 79 6c | 65 76 65 6c 20 72 65 73 |nd grayl|evel res|
|000008c0| 6f 6c 75 74 69 6f 6e 73 | 20 6f 66 20 74 68 65 20 |olutions| of the |
|000008d0| 72 65 73 75 6c 74 69 6e | 67 20 69 6d 61 67 65 2e |resultin|g image.|
|000008e0| 20 46 6f 72 0d 74 68 65 | 20 63 6f 6e 76 65 6e 69 | For.the| conveni|
|000008f0| 65 6e 63 65 20 6f 66 20 | 74 68 65 20 75 73 65 72 |ence of |the user|
|00000900| 20 74 68 69 73 20 63 61 | 6e 20 62 65 20 73 70 65 | this ca|n be spe|
|00000910| 63 69 66 69 65 64 20 62 | 79 20 73 65 74 74 69 6e |cified b|y settin|
|00000920| 67 20 65 69 74 68 65 72 | 20 74 68 65 0d 63 65 6c |g either| the.cel|
|00000930| 6c 73 50 65 72 49 6e 63 | 68 20 6f 72 20 74 68 65 |lsPerInc|h or the|
|00000940| 20 67 72 61 79 4c 65 76 | 65 6c 73 20 61 72 67 75 | grayLev|els argu|
|00000950| 6d 65 6e 74 20 74 6f 20 | 74 68 65 20 64 65 73 69 |ment to |the desi|
|00000960| 72 65 64 20 76 61 6c 75 | 65 3b 20 74 68 65 20 6f |red valu|e; the o|
|00000970| 74 68 65 72 0d 6f 6e 65 | 20 73 68 6f 75 6c 64 20 |ther.one| should |
|00000980| 62 65 20 7a 65 72 6f 2e | 20 49 66 20 62 6f 74 68 |be zero.| If both|
|00000990| 20 61 72 65 20 7a 65 72 | 6f 20 74 68 65 6e 20 74 | are zer|o then t|
|000009a0| 68 65 20 70 72 69 6e 74 | 65 72 20 77 69 6c 6c 20 |he print|er will |
|000009b0| 62 65 20 6c 65 66 74 20 | 61 74 0d 69 74 73 20 64 |be left |at.its d|
|000009c0| 65 66 61 75 6c 74 20 63 | 65 6c 6c 20 73 69 7a 65 |efault c|ell size|
|000009d0| 2c 20 77 68 69 63 68 20 | 69 73 20 75 73 75 61 6c |, which |is usual|
|000009e0| 6c 79 20 61 20 67 6f 6f | 64 20 63 68 6f 69 63 65 |ly a goo|d choice|
|000009f0| 2e 20 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 72 |. Note t|hat ther|
|00000a00| 65 0d 6e 65 65 64 20 6e | 6f 74 20 62 65 20 61 6e |e.need n|ot be an|
|00000a10| 79 20 70 61 72 74 69 63 | 75 6c 61 72 20 63 6f 72 |y partic|ular cor|
|00000a20| 72 65 73 70 6f 6e 64 65 | 6e 63 65 20 62 65 74 77 |responde|nce betw|
|00000a30| 65 65 6e 20 70 69 78 65 | 6c 73 20 69 6e 20 79 6f |een pixe|ls in yo|
|00000a40| 75 72 20 69 6d 61 67 65 | 0d 61 6e 64 20 63 65 6c |ur image|.and cel|
|00000a50| 6c 73 20 69 6e 20 74 68 | 65 20 68 61 6c 66 74 6f |ls in th|e halfto|
|00000a60| 6e 65 3b 20 74 68 65 20 | 70 72 69 6e 74 65 72 20 |ne; the |printer |
|00000a70| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 72 65 |automati|cally re|
|00000a80| 73 61 6d 70 6c 65 73 20 | 79 6f 75 72 0d 69 6d 61 |samples |your.ima|
|00000a90| 67 65 20 74 6f 20 70 72 | 6f 64 75 63 65 20 74 68 |ge to pr|oduce th|
|00000aa0| 65 20 68 61 6c 66 74 6f | 6e 65 2e 0d 09 49 66 20 |e halfto|ne...If |
|00000ab0| 79 6f 75 20 73 65 74 20 | 63 65 6c 6c 73 50 65 72 |you set |cellsPer|
|00000ac0| 49 6e 63 68 20 74 6f 20 | 61 20 6e 6f 6e 7a 65 72 |Inch to |a nonzer|
|00000ad0| 6f 20 76 61 6c 75 65 20 | 74 68 65 6e 20 74 68 65 |o value |then the|
|00000ae0| 20 70 72 69 6e 74 65 72 | 20 77 69 6c 6c 20 62 65 | printer| will be|
|00000af0| 0d 61 73 6b 65 64 20 74 | 6f 20 70 72 69 6e 74 20 |.asked t|o print |
|00000b00| 69 74 73 20 68 61 6c 66 | 74 6f 6e 65 20 77 69 74 |its half|tone wit|
|00000b10| 68 20 74 68 61 74 20 6d | 61 6e 79 20 68 61 6c 66 |h that m|any half|
|00000b20| 74 6f 6e 65 20 63 65 6c | 6c 73 20 70 65 72 20 69 |tone cel|ls per i|
|00000b30| 6e 63 68 2e 20 45 2e 67 | 2e 0d 74 6f 20 70 72 6f |nch. E.g|..to pro|
|00000b40| 64 75 63 65 20 61 20 68 | 61 6c 66 74 6f 6e 65 20 |duce a h|alftone |
|00000b50| 6f 72 69 67 69 6e 61 6c | 20 66 6f 72 20 73 75 62 |original| for sub|
|00000b60| 73 65 71 75 65 6e 74 20 | 6f 6e 65 2d 74 6f 2d 6f |sequent |one-to-o|
|00000b70| 6e 65 20 72 65 70 72 6f | 64 75 63 74 69 6f 6e 20 |ne repro|duction |
|00000b80| 69 6e 0d 61 20 6a 6f 75 | 72 6e 61 6c 2c 20 79 6f |in.a jou|rnal, yo|
|00000b90| 75 27 6c 6c 20 77 61 6e | 74 20 74 68 65 20 63 65 |u'll wan|t the ce|
|00000ba0| 6c 6c 73 20 74 6f 20 62 | 65 20 63 6f 61 72 73 65 |lls to b|e coarse|
|00000bb0| 20 65 6e 6f 75 67 68 20 | 66 6f 72 20 74 68 65 6d | enough |for them|
|00000bc0| 20 74 6f 0d 72 65 70 72 | 6f 64 75 63 65 20 77 69 | to.repr|oduce wi|
|00000bd0| 74 68 6f 75 74 20 72 65 | 2d 73 63 72 65 65 6e 69 |thout re|-screeni|
|00000be0| 6e 67 2c 20 65 2e 67 2e | 20 31 30 30 20 63 65 6c |ng, e.g.| 100 cel|
|00000bf0| 6c 73 20 70 65 72 20 69 | 6e 63 68 2e 0d 09 41 6c |ls per i|nch...Al|
|00000c00| 74 65 72 6e 61 74 69 76 | 65 6c 79 2c 20 69 66 20 |ternativ|ely, if |
|00000c10| 79 6f 75 20 73 65 74 20 | 67 72 61 79 4c 65 76 65 |you set |grayLeve|
|00000c20| 6c 73 20 74 6f 20 61 20 | 6e 6f 6e 7a 65 72 6f 20 |ls to a |nonzero |
|00000c30| 76 61 6c 75 65 20 74 68 | 65 6e 20 74 68 65 0d 70 |value th|en the.p|
|00000c40| 72 69 6e 74 65 72 20 77 | 69 6c 6c 20 62 65 20 61 |rinter w|ill be a|
|00000c50| 73 6b 65 64 20 74 6f 20 | 70 72 69 6e 74 20 69 74 |sked to |print it|
|00000c60| 73 20 68 61 6c 66 74 6f | 6e 65 20 77 69 74 68 20 |s halfto|ne with |
|00000c70| 63 65 6c 6c 73 20 63 6f | 6e 74 61 69 6e 69 6e 67 |cells co|ntaining|
|00000c80| 0d 67 72 61 79 4c 65 76 | 65 6c 73 2d 31 20 70 72 |.grayLev|els-1 pr|
|00000c90| 69 6e 74 65 72 20 70 69 | 78 65 6c 73 2c 20 79 69 |inter pi|xels, yi|
|00000ca0| 65 6c 64 69 6e 67 20 74 | 68 65 20 73 70 65 63 69 |elding t|he speci|
|00000cb0| 66 69 65 64 20 6e 75 6d | 62 65 72 20 6f 66 20 67 |fied num|ber of g|
|00000cc0| 72 61 79 0d 6c 65 76 65 | 6c 73 2e 20 45 2e 67 2e |ray.leve|ls. E.g.|
|00000cd0| 20 79 6f 75 20 6d 69 67 | 68 74 20 77 61 6e 74 20 | you mig|ht want |
|00000ce0| 74 6f 20 66 6f 72 63 65 | 20 79 6f 75 72 20 33 30 |to force| your 30|
|00000cf0| 30 20 64 70 69 20 4c 61 | 73 65 72 57 72 69 74 65 |0 dpi La|serWrite|
|00000d00| 72 20 74 6f 20 75 73 65 | 20 62 69 67 0d 63 65 6c |r to use| big.cel|
|00000d10| 6c 73 20 79 69 65 6c 64 | 69 6e 67 20 32 35 36 20 |ls yield|ing 256 |
|00000d20| 67 72 61 79 20 6c 65 76 | 65 6c 73 2e 0d 09 48 65 |gray lev|els...He|
|00000d30| 72 65 27 73 20 61 20 6d | 69 6e 69 6d 61 6c 20 65 |re's a m|inimal e|
|00000d40| 78 61 6d 70 6c 65 3a 0d | 0d 09 09 57 69 6e 64 6f |xample:.|...Windo|
|00000d50| 77 54 6f 45 50 53 28 77 | 69 6e 64 6f 77 2c 22 74 |wToEPS(w|indow,"t|
|00000d60| 65 73 74 2e 65 70 73 22 | 2c 26 72 65 63 74 2c 26 |est.eps"|,&rect,&|
|00000d70| 70 61 67 65 52 65 63 74 | 2c 30 2e 30 2c 30 2c 4e |pageRect|,0.0,0,N|
|00000d80| 55 4c 4c 29 3b 0d 0d 09 | 54 6f 20 70 72 69 6e 74 |ULL);...|To print|
|00000d90| 20 61 20 73 63 72 65 65 | 6e 20 74 6f 20 64 69 73 | a scree|n to dis|
|00000da0| 6b 2c 20 70 72 65 73 65 | 72 76 69 6e 67 20 74 68 |k, prese|rving th|
|00000db0| 65 20 73 69 7a 65 20 61 | 6e 64 20 73 63 61 6c 65 |e size a|nd scale|
|00000dc0| 20 6f 66 20 74 68 65 0d | 69 6d 61 67 65 2c 20 74 | of the.|image, t|
|00000dd0| 72 79 20 74 68 69 73 3a | 0d 0d 09 09 70 61 67 65 |ry this:|....page|
|00000de0| 52 65 63 74 3d 77 69 6e | 64 6f 77 2d 3e 70 6f 72 |Rect=win|dow->por|
|00000df0| 74 52 65 63 74 3b 0d 09 | 09 70 61 67 65 52 65 63 |tRect;..|.pageRec|
|00000e00| 74 2e 74 6f 70 2a 3d 2d | 31 3b 09 09 2f 2f 20 63 |t.top*=-|1;..// c|
|00000e10| 6f 6e 76 65 72 74 20 66 | 72 6f 6d 20 41 70 70 6c |onvert f|rom Appl|
|00000e20| 65 20 74 6f 20 41 64 6f | 62 65 20 63 6f 6f 72 64 |e to Ado|be coord|
|00000e30| 69 6e 61 74 65 73 0d 09 | 09 70 61 67 65 52 65 63 |inates..|.pageRec|
|00000e40| 74 2e 62 6f 74 74 6f 6d | 2a 3d 2d 31 3b 09 2f 2f |t.bottom|*=-1;.//|
|00000e50| 20 63 6f 6e 76 65 72 74 | 20 66 72 6f 6d 20 41 70 | convert| from Ap|
|00000e60| 70 6c 65 20 74 6f 20 41 | 64 6f 62 65 20 63 6f 6f |ple to A|dobe coo|
|00000e70| 72 64 69 6e 61 74 65 73 | 0d 09 09 53 65 74 52 65 |rdinates|...SetRe|
|00000e80| 63 74 28 26 70 61 70 65 | 72 52 65 63 74 2c 30 2c |ct(&pape|rRect,0,|
|00000e90| 31 31 2a 37 32 2c 38 2e | 35 2a 37 32 2c 30 29 3b |11*72,8.|5*72,0);|
|00000ea0| 0d 09 09 43 65 6e 74 65 | 72 52 65 63 74 49 6e 52 |...Cente|rRectInR|
|00000eb0| 65 63 74 28 26 70 61 67 | 65 52 65 63 74 2c 26 70 |ect(&pag|eRect,&p|
|00000ec0| 61 70 65 72 52 65 63 74 | 29 3b 0d 09 09 57 69 6e |aperRect|);...Win|
|00000ed0| 64 6f 77 54 6f 45 50 53 | 28 77 69 6e 64 6f 77 2c |dowToEPS|(window,|
|00000ee0| 22 74 65 73 74 2e 65 70 | 73 22 2c 26 77 69 6e 64 |"test.ep|s",&wind|
|00000ef0| 6f 77 2d 3e 70 6f 72 74 | 52 65 63 74 2c 26 70 61 |ow->port|Rect,&pa|
|00000f00| 67 65 52 65 63 74 2c 30 | 2c 30 2c 4e 55 4c 4c 29 |geRect,0|,0,NULL)|
|00000f10| 3b 0d 0d 09 54 69 6c 69 | 6e 67 20 69 73 20 73 6f |;...Tili|ng is so|
|00000f20| 6d 65 74 68 69 6e 67 20 | 77 65 20 6f 66 74 65 6e |mething |we often|
|00000f30| 20 77 61 6e 74 20 74 6f | 20 64 6f 2c 20 63 72 65 | want to| do, cre|
|00000f40| 61 74 69 6e 67 20 61 20 | 68 75 67 65 20 69 6d 61 |ating a |huge ima|
|00000f50| 67 65 20 62 79 0d 74 61 | 70 69 6e 67 20 6d 61 6e |ge by.ta|ping man|
|00000f60| 79 20 70 61 67 65 73 20 | 74 6f 67 65 74 68 65 72 |y pages |together|
|00000f70| 2e 20 53 69 6d 70 6c 79 | 20 69 6d 70 6f 72 74 20 |. Simply| import |
|00000f80| 79 6f 75 72 20 45 50 53 | 20 66 69 6c 65 20 69 6e |your EPS| file in|
|00000f90| 74 6f 20 61 20 67 6f 6f | 64 0d 67 72 61 70 68 69 |to a goo|d.graphi|
|00000fa0| 63 73 20 70 72 6f 67 72 | 61 6d 2c 20 65 2e 67 2e |cs progr|am, e.g.|
|00000fb0| 20 50 61 67 65 4d 61 6b | 65 72 2c 20 61 6e 64 20 | PageMak|er, and |
|00000fc0| 70 72 69 6e 74 20 77 69 | 74 68 20 74 69 6c 69 6e |print wi|th tilin|
|00000fd0| 67 2e 0d 0d 52 45 46 45 | 52 45 4e 43 45 53 0d 0d |g...REFE|RENCES..|
|00000fe0| 41 64 6f 62 65 20 53 79 | 73 74 65 6d 73 20 28 31 |Adobe Sy|stems (1|
|00000ff0| 39 38 35 29 20 50 6f 73 | 74 53 63 72 69 70 74 20 |985) Pos|tScript |
|00001000| 4c 61 6e 67 75 61 67 65 | 20 52 65 66 65 72 65 6e |Language| Referen|
|00001010| 63 65 20 4d 61 6e 75 61 | 6c 2c 20 53 65 63 6f 6e |ce Manua|l, Secon|
|00001020| 64 20 45 64 69 74 69 6f | 6e 2e 20 0d 52 65 61 64 |d Editio|n. .Read|
|00001030| 69 6e 67 2c 20 4d 41 3a | 20 41 64 64 69 73 6f 6e |ing, MA:| Addison|
|00001040| 2d 57 65 73 6c 65 79 2e | 0d 0d 50 65 6c 6c 69 2c |-Wesley.|..Pelli,|
|00001050| 20 44 2e 20 47 2e 20 28 | 31 39 38 37 29 20 50 72 | D. G. (|1987) Pr|
|00001060| 6f 67 72 61 6d 6d 69 6e | 67 20 69 6e 20 50 6f 73 |ogrammin|g in Pos|
|00001070| 74 53 63 72 69 70 74 3a | 20 49 6d 61 67 69 6e 67 |tScript:| Imaging|
|00001080| 20 6f 6e 20 70 61 70 65 | 72 20 66 72 6f 6d 20 61 | on pape|r from a|
|00001090| 20 6d 61 74 68 65 6d 61 | 74 69 63 61 6c 0d 64 65 | mathema|tical.de|
|000010a0| 73 63 72 69 70 74 69 6f | 6e 2e 20 42 59 54 45 2c |scriptio|n. BYTE,|
|000010b0| 20 31 32 20 28 35 29 2c | 20 31 38 35 2d 32 30 32 | 12 (5),| 185-202|
|000010c0| 2e 0d 0d 48 49 53 54 4f | 52 59 3a 0d 34 2f 32 31 |...HISTO|RY:.4/21|
|000010d0| 2f 39 31 09 64 67 70 09 | 77 72 6f 74 65 20 69 74 |/91.dgp.|wrote it|
|000010e0| 0d 37 2f 32 34 2f 39 31 | 20 64 67 70 20 61 64 64 |.7/24/91| dgp add|
|000010f0| 65 64 20 63 6f 6d 6d 65 | 6e 74 20 61 62 6f 75 74 |ed comme|nt about|
|00001100| 20 73 68 69 66 74 69 6e | 67 20 70 61 67 65 52 65 | shiftin|g pageRe|
|00001110| 63 74 0d 38 2f 32 34 2f | 39 31 09 64 67 70 09 4d |ct.8/24/|91.dgp.M|
|00001120| 61 64 65 20 63 6f 6d 70 | 61 74 69 62 6c 65 20 77 |ade comp|atible w|
|00001130| 69 74 68 20 54 48 49 4e | 4b 20 43 20 35 2e 30 0d |ith THIN|K C 5.0.|
|00001140| 31 32 2f 37 2f 39 31 09 | 64 67 70 09 6d 69 6e 6f |12/7/91.|dgp.mino|
|00001150| 72 20 65 64 69 74 69 6e | 67 20 6f 66 20 63 6f 6d |r editin|g of com|
|00001160| 6d 65 6e 74 73 0d 31 30 | 2f 31 30 2f 39 32 20 64 |ments.10|/10/92 d|
|00001170| 67 70 20 41 64 64 65 64 | 20 73 75 70 70 6f 72 74 |gp Added| support|
|00001180| 20 66 6f 72 20 50 69 78 | 6d 61 70 27 73 20 74 68 | for Pix|map's th|
|00001190| 61 74 20 72 65 71 75 69 | 72 65 20 33 32 2d 62 69 |at requi|re 32-bi|
|000011a0| 74 20 61 64 64 72 65 73 | 73 69 6e 67 2e 0d 09 09 |t addres|sing....|
|000011b0| 09 4d 75 63 68 20 66 61 | 73 74 65 72 20 6e 6f 77 |.Much fa|ster now|
|000011c0| 2c 20 75 73 69 6e 67 20 | 74 61 62 6c 65 2d 6c 6f |, using |table-lo|
|000011d0| 6f 6b 75 70 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |okup ins|tead of |
|000011e0| 73 70 72 69 6e 74 66 20 | 66 6f 72 20 0d 09 09 09 |sprintf |for ....|
|000011f0| 74 68 65 20 68 65 78 20 | 65 6e 63 6f 64 69 6e 67 |the hex |encoding|
|00001200| 2e 0d 09 09 09 44 65 6c | 65 74 65 64 20 6f 62 73 |.....Del|eted obs|
|00001210| 6f 6c 65 74 65 20 73 75 | 70 70 6f 72 74 20 66 6f |olete su|pport fo|
|00001220| 72 20 54 48 49 4e 4b 20 | 43 20 34 2e 0d 34 2f 32 |r THINK |C 4..4/2|
|00001230| 39 2f 39 33 09 64 67 70 | 09 26 20 6a 61 73 20 41 |9/93.dgp|.& jas A|
|00001240| 64 64 65 64 20 65 78 70 | 6c 61 6e 61 74 69 6f 6e |dded exp|lanation|
|00001250| 20 6f 66 20 68 6f 77 20 | 74 6f 20 64 6f 20 74 69 | of how |to do ti|
|00001260| 6c 69 6e 67 2e 0d 35 2f | 32 37 2f 39 33 09 64 67 |ling..5/|27/93.dg|
|00001270| 70 09 6d 69 6e 6f 72 20 | 65 64 69 74 69 6e 67 20 |p.minor |editing |
|00001280| 66 6f 72 20 73 70 65 65 | 64 20 61 6e 64 20 63 6c |for spee|d and cl|
|00001290| 61 72 69 74 79 0d 36 2f | 31 35 2f 39 33 09 64 67 |arity.6/|15/93.dg|
|000012a0| 70 09 46 69 78 65 64 20 | 73 69 6c 6c 79 20 62 75 |p.Fixed |silly bu|
|000012b0| 67 20 69 6e 74 72 6f 64 | 75 63 65 64 20 35 2f 32 |g introd|uced 5/2|
|000012c0| 37 2f 39 33 20 74 68 61 | 74 20 73 75 70 70 72 65 |7/93 tha|t suppre|
|000012d0| 73 73 65 64 20 61 6c 6c | 20 68 65 78 20 64 61 74 |ssed all| hex dat|
|000012e0| 61 2e 0d 09 09 09 43 61 | 6c 6c 20 53 74 72 69 70 |a.....Ca|ll Strip|
|000012f0| 41 64 64 72 65 73 73 2e | 0d 36 2f 32 39 2f 39 33 |Address.|.6/29/93|
|00001300| 09 64 67 70 09 43 68 61 | 6e 67 65 64 20 63 61 6c |.dgp.Cha|nged cal|
|00001310| 6c 20 69 6e 74 65 72 66 | 61 63 65 20 74 6f 20 61 |l interf|ace to a|
|00001320| 63 63 65 70 74 20 61 20 | 70 69 78 6d 61 70 20 68 |ccept a |pixmap h|
|00001330| 61 6e 64 6c 65 20 69 6e | 73 74 65 61 64 20 6f 66 |andle in|stead of|
|00001340| 20 61 20 70 6f 69 6e 74 | 65 72 2e 0d 09 09 09 54 | a point|er.....T|
|00001350| 68 65 20 70 72 6f 62 6c | 65 6d 20 77 69 74 68 20 |he probl|em with |
|00001360| 61 63 63 65 70 74 69 6e | 67 20 61 20 70 6f 69 6e |acceptin|g a poin|
|00001370| 74 65 72 20 69 73 20 74 | 68 61 74 20 74 68 65 20 |ter is t|hat the |
|00001380| 75 73 65 72 20 6d 75 73 | 74 20 72 65 6d 65 6d 62 |user mus|t rememb|
|00001390| 65 72 0d 09 09 09 74 6f | 20 6c 6f 63 6b 20 74 68 |er....to| lock th|
|000013a0| 65 20 68 61 6e 64 6c 65 | 20 62 65 66 6f 72 65 20 |e handle| before |
|000013b0| 64 65 72 65 66 65 72 65 | 6e 63 69 6e 67 20 69 74 |derefere|ncing it|
|000013c0| 20 74 6f 20 67 65 74 20 | 74 68 65 20 70 6f 69 6e | to get |the poin|
|000013d0| 74 65 72 2c 20 61 6e 64 | 0d 09 09 09 6c 6f 74 73 |ter, and|....lots|
|000013e0| 20 6f 66 20 70 65 6f 70 | 6c 65 20 66 6f 72 67 65 | of peop|le forge|
|000013f0| 74 2c 20 6c 65 61 64 69 | 6e 67 20 74 6f 20 61 20 |t, leadi|ng to a |
|00001400| 6d 79 73 74 65 72 69 6f | 75 73 20 63 72 61 73 68 |mysterio|us crash|
|00001410| 2e 20 4e 6f 77 20 74 68 | 65 20 6c 6f 63 6b 69 6e |. Now th|e lockin|
|00001420| 67 0d 09 09 09 69 73 20 | 68 61 6e 64 6c 65 64 20 |g....is |handled |
|00001430| 69 6e 74 65 72 6e 61 6c | 6c 79 2c 20 61 75 74 6f |internal|ly, auto|
|00001440| 6d 61 74 69 63 61 6c 6c | 79 2e 0d 36 2f 33 30 2f |maticall|y..6/30/|
|00001450| 39 33 09 64 67 70 09 41 | 64 64 65 64 20 65 78 61 |93.dgp.A|dded exa|
|00001460| 6d 70 6c 65 2c 20 61 62 | 6f 76 65 2c 20 73 68 6f |mple, ab|ove, sho|
|00001470| 77 69 6e 67 20 68 6f 77 | 20 74 6f 20 70 72 69 6e |wing how| to prin|
|00001480| 74 20 73 63 72 65 65 6e | 20 74 6f 20 64 69 73 6b |t screen| to disk|
|00001490| 2e 0d 37 2f 39 2f 39 33 | 09 64 67 70 20 63 68 65 |..7/9/93|.dgp che|
|000014a0| 63 6b 20 66 6f 72 20 33 | 32 2d 62 69 74 20 61 64 |ck for 3|2-bit ad|
|000014b0| 64 72 65 73 73 69 6e 67 | 20 63 61 70 61 62 69 6c |dressing| capabil|
|000014c0| 69 74 79 2e 0d 31 32 2f | 31 35 2f 39 33 20 64 67 |ity..12/|15/93 dg|
|000014d0| 70 20 61 64 64 65 64 20 | 66 69 6c 65 6e 61 6d 65 |p added |filename|
|000014e0| 20 61 72 67 75 6d 65 6e | 74 20 74 6f 20 74 68 65 | argumen|t to the|
|000014f0| 20 64 69 61 67 6e 6f 73 | 74 69 63 20 6d 65 73 73 | diagnos|tic mess|
|00001500| 61 67 65 73 2e 0d 09 09 | 09 43 6f 72 72 65 63 74 |ages....|.Correct|
|00001510| 65 64 20 67 72 61 79 4c | 65 76 65 6c 73 20 74 6f |ed grayL|evels to|
|00001520| 20 67 72 61 79 4c 65 76 | 65 6c 73 2d 31 20 69 6e | grayLev|els-1 in|
|00001530| 20 63 6f 6d 70 75 74 69 | 6e 67 0d 09 09 09 74 68 | computi|ng....th|
|00001540| 65 20 72 65 71 75 69 72 | 65 64 20 6e 75 6d 62 65 |e requir|ed numbe|
|00001550| 72 20 6f 66 20 70 69 78 | 65 6c 73 20 69 6e 20 74 |r of pix|els in t|
|00001560| 68 65 20 68 61 6c 66 74 | 6f 6e 65 20 63 65 6c 6c |he halft|one cell|
|00001570| 2e 0d 36 2f 31 38 2f 39 | 34 09 64 67 70 09 63 61 |..6/18/9|4.dgp.ca|
|00001580| 6e 33 32 20 69 73 20 6e | 6f 77 20 63 6f 6d 70 75 |n32 is n|ow compu|
|00001590| 74 65 64 20 62 79 20 63 | 61 6c 6c 69 6e 67 20 54 |ted by c|alling T|
|000015a0| 72 61 70 41 76 61 69 6c | 61 62 6c 65 28 5f 53 77 |rapAvail|able(_Sw|
|000015b0| 61 70 4d 4d 55 4d 6f 64 | 65 29 2c 20 77 68 69 63 |apMMUMod|e), whic|
|000015c0| 68 20 0d 09 09 09 72 65 | 74 75 72 6e 73 20 74 68 |h ....re|turns th|
|000015d0| 65 20 63 6f 72 72 65 63 | 74 20 61 6e 73 77 65 72 |e correc|t answer|
|000015e0| 20 65 76 65 6e 20 6f 6e | 20 4d 61 63 73 20 77 69 | even on| Macs wi|
|000015f0| 74 68 20 64 69 72 74 79 | 20 52 4f 4d 73 2e 0d 39 |th dirty| ROMs..9|
|00001600| 2f 35 2f 39 34 20 64 67 | 70 20 72 65 6d 6f 76 65 |/5/94 dg|p remove|
|00001610| 64 20 61 73 73 75 6d 70 | 74 69 6f 6e 20 69 6e 20 |d assump|tion in |
|00001620| 70 72 69 6e 74 66 27 73 | 20 74 68 61 74 20 69 6e |printf's| that in|
|00001630| 74 3d 3d 73 68 6f 72 74 | 2e 0d 2a 2f 0d 23 69 6e |t==short|..*/.#in|
|00001640| 63 6c 75 64 65 20 22 56 | 69 64 65 6f 54 6f 6f 6c |clude "V|ideoTool|
|00001650| 62 6f 78 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |box.h".#|include |
|00001660| 3c 61 73 73 65 72 74 2e | 68 3e 0d 23 69 6e 63 6c |<assert.|h>.#incl|
|00001670| 75 64 65 20 3c 6d 61 74 | 68 2e 68 3e 0d 23 69 6e |ude <mat|h.h>.#in|
|00001680| 63 6c 75 64 65 20 3c 54 | 72 61 70 73 2e 68 3e 09 |clude <T|raps.h>.|
|00001690| 2f 2f 20 5f 53 77 61 70 | 4d 4d 55 4d 6f 64 65 0d |// _Swap|MMUMode.|
|000016a0| 23 64 65 66 69 6e 65 20 | 43 52 45 41 54 4f 52 20 |#define |CREATOR |
|000016b0| 27 52 2a 63 68 27 09 2f | 2a 20 66 6f 72 20 42 42 |'R*ch'./|* for BB|
|000016c0| 45 64 69 74 20 2a 2f 0d | 0d 76 6f 69 64 20 57 69 |Edit */.|.void Wi|
|000016d0| 6e 64 6f 77 54 6f 45 50 | 53 28 43 57 69 6e 64 6f |ndowToEP|S(CWindo|
|000016e0| 77 50 74 72 20 77 69 6e | 64 6f 77 2c 63 68 61 72 |wPtr win|dow,char|
|000016f0| 20 2a 66 69 6c 65 6e 61 | 6d 65 2c 52 65 63 74 20 | *filena|me,Rect |
|00001700| 2a 72 65 63 74 50 74 72 | 0d 09 2c 52 65 63 74 20 |*rectPtr|..,Rect |
|00001710| 2a 70 61 67 65 52 65 63 | 74 50 74 72 2c 64 6f 75 |*pageRec|tPtr,dou|
|00001720| 62 6c 65 20 63 65 6c 6c | 73 50 65 72 49 6e 63 68 |ble cell|sPerInch|
|00001730| 2c 69 6e 74 20 67 72 61 | 79 4c 65 76 65 6c 73 2c |,int gra|yLevels,|
|00001740| 66 6c 6f 61 74 20 72 65 | 66 6c 65 63 74 61 6e 63 |float re|flectanc|
|00001750| 65 5b 32 35 36 5d 29 0d | 7b 0d 09 50 69 78 4d 61 |e[256]).|{..PixMa|
|00001760| 70 20 2a 2a 70 6d 3b 0d | 09 46 49 4c 45 20 2a 66 |p **pm;.|.FILE *f|
|00001770| 69 6c 65 3b 0d 09 75 6e | 73 69 67 6e 65 64 20 63 |ile;..un|signed c|
|00001780| 68 61 72 20 2a 61 64 64 | 72 3b 0d 09 6c 6f 6e 67 |har *add|r;..long|
|00001790| 20 79 2c 62 79 74 65 73 | 2c 77 69 64 74 68 3b 0d | y,bytes|,width;.|
|000017a0| 09 72 65 67 69 73 74 65 | 72 20 6c 6f 6e 67 20 69 |.registe|r long i|
|000017b0| 3b 0d 09 75 6e 73 69 67 | 6e 65 64 20 73 68 6f 72 |;..unsig|ned shor|
|000017c0| 74 20 2a 62 75 66 66 65 | 72 2c 2a 62 75 66 66 65 |t *buffe|r,*buffe|
|000017d0| 72 33 32 3b 0d 09 72 65 | 67 69 73 74 65 72 20 75 |r32;..re|gister u|
|000017e0| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 20 2a 77 |nsigned |short *w|
|000017f0| 6f 72 64 2c 68 65 78 5b | 32 35 36 5d 3b 0d 09 72 |ord,hex[|256];..r|
|00001800| 65 67 69 73 74 65 72 20 | 75 6e 73 69 67 6e 65 64 |egister |unsigned|
|00001810| 20 63 68 61 72 20 2a 62 | 79 74 65 3b 0d 09 73 68 | char *b|yte;..sh|
|00001820| 6f 72 74 20 70 69 78 65 | 6c 53 69 7a 65 3b 0d 09 |ort pixe|lSize;..|
|00001830| 73 68 6f 72 74 20 72 6f | 77 42 79 74 65 73 3b 0d |short ro|wBytes;.|
|00001840| 09 74 69 6d 65 5f 74 20 | 41 4e 53 49 54 69 6d 65 |.time_t |ANSITime|
|00001850| 3b 0d 09 63 68 61 72 20 | 73 74 72 69 6e 67 5b 31 |;..char |string[1|
|00001860| 30 30 5d 3b 0d 09 63 68 | 61 72 20 6d 6f 64 65 2c |00];..ch|ar mode,|
|00001870| 70 6d 53 74 61 74 65 3b | 0d 09 73 74 61 74 69 63 |pmState;|..static|
|00001880| 20 42 6f 6f 6c 65 61 6e | 20 63 61 6e 33 32 2c 69 | Boolean| can32,i|
|00001890| 73 33 32 2c 66 69 72 73 | 74 54 69 6d 65 3d 31 3b |s32,firs|tTime=1;|
|000018a0| 0d 09 6c 6f 6e 67 20 67 | 65 73 74 61 6c 74 3b 0d |..long g|estalt;.|
|000018b0| 09 69 6e 74 20 6f 6b 3b | 0d 0d 09 61 73 73 65 72 |.int ok;|...asser|
|000018c0| 74 28 53 74 61 63 6b 53 | 70 61 63 65 28 29 3e 35 |t(StackS|pace()>5|
|000018d0| 30 30 30 29 3b 0d 09 69 | 66 28 66 69 72 73 74 54 |000);..i|f(firstT|
|000018e0| 69 6d 65 29 7b 0d 09 09 | 47 65 73 74 61 6c 74 28 |ime){...|Gestalt(|
|000018f0| 67 65 73 74 61 6c 74 41 | 64 64 72 65 73 73 69 6e |gestaltA|ddressin|
|00001900| 67 4d 6f 64 65 41 74 74 | 72 2c 26 67 65 73 74 61 |gModeAtt|r,&gesta|
|00001910| 6c 74 29 3b 0d 09 09 69 | 73 33 32 3d 67 65 73 74 |lt);...i|s32=gest|
|00001920| 61 6c 74 26 28 31 3c 3c | 67 65 73 74 61 6c 74 33 |alt&(1<<|gestalt3|
|00001930| 32 42 69 74 41 64 64 72 | 65 73 73 69 6e 67 29 3b |2BitAddr|essing);|
|00001940| 0d 09 09 63 61 6e 33 32 | 3d 54 72 61 70 41 76 61 |...can32|=TrapAva|
|00001950| 69 6c 61 62 6c 65 28 5f | 53 77 61 70 4d 4d 55 4d |ilable(_|SwapMMUM|
|00001960| 6f 64 65 29 3b 0d 09 09 | 66 69 72 73 74 54 69 6d |ode);...|firstTim|
|00001970| 65 3d 30 3b 0d 09 7d 0d | 09 69 66 28 49 73 47 57 |e=0;..}.|.if(IsGW|
|00001980| 6f 72 6c 64 50 74 72 28 | 77 69 6e 64 6f 77 29 29 |orldPtr(|window))|
|00001990| 7b 0d 09 09 2f 2f 20 49 | 74 27 73 20 61 20 47 57 |{...// I|t's a GW|
|000019a0| 6f 72 6c 64 50 74 72 2c | 20 6c 6f 63 6b 20 74 68 |orldPtr,| lock th|
|000019b0| 65 20 70 69 78 65 6c 73 | 2e 0d 09 09 6f 6b 3d 4c |e pixels|....ok=L|
|000019c0| 6f 63 6b 50 69 78 65 6c | 73 28 47 65 74 47 57 6f |ockPixel|s(GetGWo|
|000019d0| 72 6c 64 50 69 78 4d 61 | 70 28 28 47 57 6f 72 6c |rldPixMa|p((GWorl|
|000019e0| 64 50 74 72 29 77 69 6e | 64 6f 77 29 29 3b 0d 09 |dPtr)win|dow));..|
|000019f0| 09 69 66 28 21 6f 6b 29 | 50 72 69 6e 74 66 45 78 |.if(!ok)|PrintfEx|
|00001a00| 69 74 28 22 25 73 3a 20 | 63 61 6e 27 74 20 4c 6f |it("%s: |can't Lo|
|00001a10| 63 6b 50 69 78 65 6c 73 | 20 6f 6e 20 47 57 6f 72 |ckPixels| on GWor|
|00001a20| 6c 64 2e 5c 6e 22 2c 5f | 5f 46 49 4c 45 5f 5f 29 |ld.\n",_|_FILE__)|
|00001a30| 3b 0d 09 09 70 6d 3d 47 | 65 74 47 57 6f 72 6c 64 |;...pm=G|etGWorld|
|00001a40| 50 69 78 4d 61 70 28 28 | 47 57 6f 72 6c 64 50 74 |PixMap((|GWorldPt|
|00001a50| 72 29 77 69 6e 64 6f 77 | 29 3b 0d 09 7d 65 6c 73 |r)window|);..}els|
|00001a60| 65 20 69 66 28 77 69 6e | 64 6f 77 2d 3e 70 6f 72 |e if(win|dow->por|
|00001a70| 74 56 65 72 73 69 6f 6e | 3c 30 29 7b 09 2f 2f 20 |tVersion|<0){.// |
|00001a80| 49 73 20 69 74 20 61 20 | 43 47 72 61 66 50 6f 72 |Is it a |CGrafPor|
|00001a90| 74 20 6f 72 20 61 20 47 | 72 61 66 50 6f 72 74 3f |t or a G|rafPort?|
|00001aa0| 0d 09 09 2f 2f 20 49 74 | 27 73 20 61 20 43 47 72 |...// It|'s a CGr|
|00001ab0| 61 66 50 6f 72 74 2e 0d | 09 09 70 6d 3d 77 69 6e |afPort..|..pm=win|
|00001ac0| 64 6f 77 2d 3e 70 6f 72 | 74 50 69 78 4d 61 70 3b |dow->por|tPixMap;|
|00001ad0| 0d 09 7d 65 6c 73 65 7b | 0d 09 09 2f 2f 20 49 74 |..}else{|...// It|
|00001ae0| 27 73 20 61 20 47 72 61 | 66 50 6f 72 74 2e 0d 09 |'s a Gra|fPort...|
|00001af0| 09 50 72 69 6e 74 66 45 | 78 69 74 28 22 25 73 3a |.PrintfE|xit("%s:|
|00001b00| 20 73 6f 75 72 63 65 20 | 6d 75 73 74 20 62 65 20 | source |must be |
|00001b10| 47 57 6f 72 6c 64 20 6f | 72 20 63 6f 6c 6f 72 20 |GWorld o|r color |
|00001b20| 57 69 6e 64 6f 77 2e 5c | 6e 22 2c 5f 5f 46 49 4c |Window.\|n",__FIL|
|00001b30| 45 5f 5f 29 3b 0d 09 7d | 0d 09 69 66 28 63 65 6c |E__);..}|..if(cel|
|00001b40| 6c 73 50 65 72 49 6e 63 | 68 21 3d 30 2e 30 20 26 |lsPerInc|h!=0.0 &|
|00001b50| 26 20 67 72 61 79 4c 65 | 76 65 6c 73 21 3d 30 2e |& grayLe|vels!=0.|
|00001b60| 30 29 50 72 69 6e 74 66 | 45 78 69 74 28 22 25 73 |0)Printf|Exit("%s|
|00001b70| 28 25 73 29 3a 20 22 0d | 09 09 22 79 6f 75 20 6d |(%s): ".|.."you m|
|00001b80| 61 79 20 6e 6f 74 20 73 | 70 65 63 69 66 79 20 42 |ay not s|pecify B|
|00001b90| 4f 54 48 20 63 65 6c 6c | 73 50 65 72 49 6e 63 68 |OTH cell|sPerInch|
|00001ba0| 20 26 20 67 72 61 79 4c | 65 76 65 6c 73 2e 5c 6e | & grayL|evels.\n|
|00001bb0| 22 0d 09 09 22 53 65 74 | 20 6f 6e 65 20 74 6f 20 |"..."Set| one to |
|00001bc0| 7a 65 72 6f 2e 5c 6e 22 | 2c 5f 5f 46 49 4c 45 5f |zero.\n"|,__FILE_|
|00001bd0| 5f 2c 66 69 6c 65 6e 61 | 6d 65 29 3b 0d 09 66 69 |_,filena|me);..fi|
|00001be0| 6c 65 3d 66 6f 70 65 6e | 28 66 69 6c 65 6e 61 6d |le=fopen|(filenam|
|00001bf0| 65 2c 22 77 22 29 3b 0d | 09 69 66 28 66 69 6c 65 |e,"w");.|.if(file|
|00001c00| 3d 3d 4e 55 4c 4c 29 50 | 72 69 6e 74 66 45 78 69 |==NULL)P|rintfExi|
|00001c10| 74 28 22 25 73 3a 20 45 | 72 72 6f 72 20 69 6e 20 |t("%s: E|rror in |
|00001c20| 6f 70 65 6e 69 6e 67 20 | 66 69 6c 65 20 d2 25 73 |opening |file .%s|
|00001c30| d3 2e 5c 6e 22 0d 09 09 | 2c 5f 5f 46 49 4c 45 5f |..\n"...|,__FILE_|
|00001c40| 5f 2c 66 69 6c 65 6e 61 | 6d 65 29 3b 0d 09 70 6d |_,filena|me);..pm|
|00001c50| 53 74 61 74 65 3d 48 47 | 65 74 53 74 61 74 65 28 |State=HG|etState(|
|00001c60| 28 48 61 6e 64 6c 65 29 | 70 6d 29 3b 0d 09 48 4c |(Handle)|pm);..HL|
|00001c70| 6f 63 6b 28 28 48 61 6e | 64 6c 65 29 70 6d 29 3b |ock((Han|dle)pm);|
|00001c80| 0d 09 61 64 64 72 3d 52 | 65 63 74 54 6f 41 64 64 |..addr=R|ectToAdd|
|00001c90| 72 65 73 73 28 2a 70 6d | 2c 72 65 63 74 50 74 72 |ress(*pm|,rectPtr|
|00001ca0| 2c 26 72 6f 77 42 79 74 | 65 73 2c 26 70 69 78 65 |,&rowByt|es,&pixe|
|00001cb0| 6c 53 69 7a 65 2c 4e 55 | 4c 4c 29 3b 0d 09 69 66 |lSize,NU|LL);..if|
|00001cc0| 28 61 64 64 72 3d 3d 4e | 55 4c 4c 29 50 72 69 6e |(addr==N|ULL)Prin|
|00001cd0| 74 66 45 78 69 74 28 22 | 25 73 28 25 73 29 3a 20 |tfExit("|%s(%s): |
|00001ce0| 42 61 64 20 50 69 78 4d | 61 70 2e 5c 6e 22 2c 5f |Bad PixM|ap.\n",_|
|00001cf0| 5f 46 49 4c 45 5f 5f 2c | 66 69 6c 65 6e 61 6d 65 |_FILE__,|filename|
|00001d00| 29 3b 0d 09 69 66 28 70 | 69 78 65 6c 53 69 7a 65 |);..if(p|ixelSize|
|00001d10| 21 3d 38 29 50 72 69 6e | 74 66 45 78 69 74 28 22 |!=8)Prin|tfExit("|
|00001d20| 25 73 28 25 73 29 3a 20 | 22 0d 09 09 22 53 6f 72 |%s(%s): |"..."Sor|
|00001d30| 72 79 2c 20 70 69 78 65 | 6c 53 69 7a 65 20 6d 75 |ry, pixe|lSize mu|
|00001d40| 73 74 20 62 65 20 38 2c | 20 6e 6f 74 20 25 64 2e |st be 8,| not %d.|
|00001d50| 5c 6e 22 2c 5f 5f 46 49 | 4c 45 5f 5f 2c 66 69 6c |\n",__FI|LE__,fil|
|00001d60| 65 6e 61 6d 65 2c 28 69 | 6e 74 29 70 69 78 65 6c |ename,(i|nt)pixel|
|00001d70| 53 69 7a 65 29 3b 0d 09 | 74 69 6d 65 28 26 41 4e |Size);..|time(&AN|
|00001d80| 53 49 54 69 6d 65 29 3b | 0d 09 73 74 72 66 74 69 |SITime);|..strfti|
|00001d90| 6d 65 28 73 74 72 69 6e | 67 2c 73 69 7a 65 6f 66 |me(strin|g,sizeof|
|00001da0| 28 73 74 72 69 6e 67 29 | 2c 22 25 49 3a 25 4d 20 |(string)|,"%I:%M |
|00001db0| 25 70 20 25 41 2c 20 25 | 42 20 25 64 2c 20 25 59 |%p %A, %|B %d, %Y|
|00001dc0| 22 2c 6c 6f 63 61 6c 74 | 69 6d 65 28 26 41 4e 53 |",localt|ime(&ANS|
|00001dd0| 49 54 69 6d 65 29 29 3b | 0d 09 66 70 72 69 6e 74 |ITime));|..fprint|
|00001de0| 66 28 66 69 6c 65 2c 0d | 09 09 22 25 25 21 50 53 |f(file,.|.."%%!PS|
|00001df0| 2d 41 64 6f 62 65 2d 32 | 2e 30 20 45 50 53 46 2d |-Adobe-2|.0 EPSF-|
|00001e00| 31 2e 32 5c 6e 22 29 3b | 0d 09 66 70 72 69 6e 74 |1.2\n");|..fprint|
|00001e10| 66 28 66 69 6c 65 2c 0d | 09 09 22 25 25 25 25 43 |f(file,.|.."%%%%C|
|00001e20| 72 65 61 74 6f 72 3a 25 | 73 5c 6e 22 2c 49 64 65 |reator:%|s\n",Ide|
|00001e30| 6e 74 69 66 79 41 70 70 | 6c 69 63 61 74 69 6f 6e |ntifyApp|lication|
|00001e40| 28 29 29 3b 0d 09 66 70 | 72 69 6e 74 66 28 66 69 |());..fp|rintf(fi|
|00001e50| 6c 65 2c 0d 09 09 22 25 | 25 25 25 46 6f 72 3a 25 |le,..."%|%%%For:%|
|00001e60| 73 5c 6e 22 2c 49 64 65 | 6e 74 69 66 79 4f 77 6e |s\n",Ide|ntifyOwn|
|00001e70| 65 72 28 29 29 3b 0d 09 | 66 70 72 69 6e 74 66 28 |er());..|fprintf(|
|00001e80| 66 69 6c 65 2c 0d 09 09 | 22 25 25 25 25 54 69 74 |file,...|"%%%%Tit|
|00001e90| 6c 65 3a 25 73 5c 6e 22 | 2c 66 69 6c 65 6e 61 6d |le:%s\n"|,filenam|
|00001ea0| 65 29 3b 0d 09 66 70 72 | 69 6e 74 66 28 66 69 6c |e);..fpr|intf(fil|
|00001eb0| 65 2c 0d 09 09 22 25 25 | 25 25 43 72 65 61 74 69 |e,..."%%|%%Creati|
|00001ec0| 6f 6e 44 61 74 65 3a 25 | 73 5c 6e 22 2c 73 74 72 |onDate:%|s\n",str|
|00001ed0| 69 6e 67 29 3b 0d 09 66 | 70 72 69 6e 74 66 28 66 |ing);..f|printf(f|
|00001ee0| 69 6c 65 2c 0d 09 09 22 | 25 25 25 25 50 61 67 65 |ile,..."|%%%%Page|
|00001ef0| 73 3a 20 30 5c 6e 22 0d | 09 09 22 25 25 25 25 42 |s: 0\n".|.."%%%%B|
|00001f00| 6f 75 6e 64 69 6e 67 42 | 6f 78 3a 25 64 20 25 64 |oundingB|ox:%d %d|
|00001f10| 20 25 64 20 25 64 5c 6e | 22 0d 09 09 2c 28 69 6e | %d %d\n|"...,(in|
|00001f20| 74 29 70 61 67 65 52 65 | 63 74 50 74 72 2d 3e 6c |t)pageRe|ctPtr->l|
|00001f30| 65 66 74 2c 28 69 6e 74 | 29 70 61 67 65 52 65 63 |eft,(int|)pageRec|
|00001f40| 74 50 74 72 2d 3e 62 6f | 74 74 6f 6d 0d 09 09 2c |tPtr->bo|ttom...,|
|00001f50| 28 69 6e 74 29 70 61 67 | 65 52 65 63 74 50 74 72 |(int)pag|eRectPtr|
|00001f60| 2d 3e 72 69 67 68 74 2c | 28 69 6e 74 29 70 61 67 |->right,|(int)pag|
|00001f70| 65 52 65 63 74 50 74 72 | 2d 3e 74 6f 70 29 3b 0d |eRectPtr|->top);.|
|00001f80| 09 66 70 72 69 6e 74 66 | 28 66 69 6c 65 2c 0d 09 |.fprintf|(file,..|
|00001f90| 09 22 25 25 25 25 45 6e | 64 43 6f 6d 6d 65 6e 74 |."%%%%En|dComment|
|00001fa0| 73 5c 6e 22 0d 09 09 22 | 25 25 25 25 42 65 67 69 |s\n"..."|%%%%Begi|
|00001fb0| 6e 50 72 6f 6c 6f 67 5c | 6e 22 0d 09 09 22 25 25 |nProlog\|n"..."%%|
|00001fc0| 25 25 45 6e 64 50 72 6f | 6c 6f 67 5c 6e 22 0d 09 |%%EndPro|log\n"..|
|00001fd0| 09 22 25 25 25 25 42 65 | 67 69 6e 53 65 74 75 70 |."%%%%Be|ginSetup|
|00001fe0| 5c 6e 22 0d 09 09 22 2f | 56 69 64 65 6f 54 6f 6f |\n"..."/|VideoToo|
|00001ff0| 6c 62 6f 78 20 64 75 70 | 20 32 35 20 64 69 63 74 |lbox dup| 25 dict|
|00002000| 20 64 65 66 20 6c 6f 61 | 64 20 62 65 67 69 6e 5c | def loa|d begin\|
|00002010| 6e 22 0d 09 09 22 65 6e | 64 5c 6e 22 0d 09 09 22 |n"..."en|d\n"..."|
|00002020| 56 69 64 65 6f 54 6f 6f | 6c 62 6f 78 20 62 65 67 |VideoToo|lbox beg|
|00002030| 69 6e 5c 6e 22 0d 09 09 | 22 67 73 61 76 65 5c 6e |in\n"...|"gsave\n|
|00002040| 22 0d 09 09 22 25 25 25 | 25 45 6e 64 53 65 74 75 |"..."%%%|%EndSetu|
|00002050| 70 5c 6e 22 29 3b 0d 09 | 66 70 72 69 6e 74 66 28 |p\n");..|fprintf(|
|00002060| 66 69 6c 65 2c 0d 09 09 | 22 2f 6e 78 20 25 64 20 |file,...|"/nx %d |
|00002070| 64 65 66 09 09 09 09 25 | 25 20 70 69 78 65 6c 73 |def....%|% pixels|
|00002080| 20 70 65 72 20 72 61 73 | 74 65 72 20 6c 69 6e 65 | per ras|ter line|
|00002090| 5c 6e 22 2c 28 69 6e 74 | 29 28 72 65 63 74 50 74 |\n",(int|)(rectPt|
|000020a0| 72 2d 3e 72 69 67 68 74 | 2d 72 65 63 74 50 74 72 |r->right|-rectPtr|
|000020b0| 2d 3e 6c 65 66 74 29 29 | 3b 0d 09 66 70 72 69 6e |->left))|;..fprin|
|000020c0| 74 66 28 66 69 6c 65 2c | 0d 09 09 22 2f 6e 79 20 |tf(file,|..."/ny |
|000020d0| 25 64 20 64 65 66 09 09 | 09 09 25 25 20 6c 69 6e |%d def..|..%% lin|
|000020e0| 65 73 20 69 6e 20 69 6d | 61 67 65 5c 6e 22 2c 28 |es in im|age\n",(|
|000020f0| 69 6e 74 29 28 72 65 63 | 74 50 74 72 2d 3e 62 6f |int)(rec|tPtr->bo|
|00002100| 74 74 6f 6d 2d 72 65 63 | 74 50 74 72 2d 3e 74 6f |ttom-rec|tPtr->to|
|00002110| 70 29 29 3b 0d 09 66 70 | 72 69 6e 74 66 28 66 69 |p));..fp|rintf(fi|
|00002120| 6c 65 2c 0d 09 09 22 2f | 68 79 70 6f 74 65 6e 75 |le,..."/|hypotenu|
|00002130| 73 65 20 7b 64 75 70 20 | 6d 75 6c 20 65 78 63 68 |se {dup |mul exch|
|00002140| 20 64 75 70 20 6d 75 6c | 20 61 64 64 20 73 71 72 | dup mul| add sqr|
|00002150| 74 7d 20 62 69 6e 64 20 | 64 65 66 5c 6e 22 0d 09 |t} bind |def\n"..|
|00002160| 09 22 2f 70 69 78 65 6c | 73 50 65 72 49 6e 63 68 |."/pixel|sPerInch|
|00002170| 20 67 73 61 76 65 20 69 | 6e 69 74 6d 61 74 72 69 | gsave i|nitmatri|
|00002180| 78 20 37 32 20 30 20 64 | 74 72 61 6e 73 66 6f 72 |x 72 0 d|transfor|
|00002190| 6d 20 68 79 70 6f 74 65 | 6e 75 73 65 20 67 72 65 |m hypote|nuse gre|
|000021a0| 73 74 6f 72 65 20 64 65 | 66 5c 6e 22 0d 09 09 22 |store de|f\n"..."|
|000021b0| 25 64 20 25 64 20 74 72 | 61 6e 73 6c 61 74 65 09 |%d %d tr|anslate.|
|000021c0| 09 25 25 20 6c 6f 63 61 | 74 65 20 6c 6f 77 65 72 |.%% loca|te lower|
|000021d0| 20 6c 65 66 74 20 6f 66 | 20 69 6d 61 67 65 5c 6e | left of| image\n|
|000021e0| 22 0d 09 09 2c 28 69 6e | 74 29 70 61 67 65 52 65 |"...,(in|t)pageRe|
|000021f0| 63 74 50 74 72 2d 3e 6c | 65 66 74 2c 28 69 6e 74 |ctPtr->l|eft,(int|
|00002200| 29 70 61 67 65 52 65 63 | 74 50 74 72 2d 3e 62 6f |)pageRec|tPtr->bo|
|00002210| 74 74 6f 6d 29 3b 0d 09 | 66 70 72 69 6e 74 66 28 |ttom);..|fprintf(|
|00002220| 66 69 6c 65 2c 0d 09 09 | 22 25 64 20 25 64 20 73 |file,...|"%d %d s|
|00002230| 63 61 6c 65 09 09 09 25 | 25 20 70 72 69 6e 74 20 |cale...%|% print |
|00002240| 69 6d 61 67 65 20 77 69 | 74 68 20 74 68 65 73 65 |image wi|th these|
|00002250| 20 64 69 6d 65 6e 73 69 | 6f 6e 73 20 6f 6e 20 70 | dimensi|ons on p|
|00002260| 61 67 65 5c 6e 22 0d 09 | 09 2c 28 69 6e 74 29 28 |age\n"..|.,(int)(|
|00002270| 70 61 67 65 52 65 63 74 | 50 74 72 2d 3e 72 69 67 |pageRect|Ptr->rig|
|00002280| 68 74 2d 70 61 67 65 52 | 65 63 74 50 74 72 2d 3e |ht-pageR|ectPtr->|
|00002290| 6c 65 66 74 29 2c 28 69 | 6e 74 29 28 70 61 67 65 |left),(i|nt)(page|
|000022a0| 52 65 63 74 50 74 72 2d | 3e 74 6f 70 2d 70 61 67 |RectPtr-|>top-pag|
|000022b0| 65 52 65 63 74 50 74 72 | 2d 3e 62 6f 74 74 6f 6d |eRectPtr|->bottom|
|000022c0| 29 29 3b 0d 09 69 66 28 | 63 65 6c 6c 73 50 65 72 |));..if(|cellsPer|
|000022d0| 49 6e 63 68 21 3d 30 2e | 30 29 7b 0d 09 09 66 70 |Inch!=0.|0){...fp|
|000022e0| 72 69 6e 74 66 28 66 69 | 6c 65 2c 0d 09 09 09 22 |rintf(fi|le,...."|
|000022f0| 2f 63 65 6c 6c 73 50 65 | 72 49 6e 63 68 20 25 2e |/cellsPe|rInch %.|
|00002300| 32 66 20 64 65 66 09 25 | 25 20 68 61 6c 66 74 6f |2f def.%|% halfto|
|00002310| 6e 65 20 64 6f 74 20 66 | 72 65 71 75 65 6e 63 79 |ne dot f|requency|
|00002320| 5c 6e 22 2c 63 65 6c 6c | 73 50 65 72 49 6e 63 68 |\n",cell|sPerInch|
|00002330| 29 3b 0d 09 09 66 70 72 | 69 6e 74 66 28 66 69 6c |);...fpr|intf(fil|
|00002340| 65 2c 0d 09 09 09 22 63 | 65 6c 6c 73 50 65 72 49 |e,...."c|ellsPerI|
|00002350| 6e 63 68 20 63 75 72 72 | 65 6e 74 73 63 72 65 65 |nch curr|entscree|
|00002360| 6e 20 34 20 2d 32 20 72 | 6f 6c 6c 20 70 6f 70 20 |n 4 -2 r|oll pop |
|00002370| 33 20 31 20 72 6f 6c 6c | 20 73 65 74 73 63 72 65 |3 1 roll| setscre|
|00002380| 65 6e 5c 6e 22 29 3b 0d | 09 7d 0d 09 69 66 28 67 |en\n");.|.}..if(g|
|00002390| 72 61 79 4c 65 76 65 6c | 73 21 3d 30 29 7b 0d 09 |rayLevel|s!=0){..|
|000023a0| 09 66 70 72 69 6e 74 66 | 28 66 69 6c 65 2c 0d 09 |.fprintf|(file,..|
|000023b0| 09 09 22 2f 63 65 6c 6c | 73 50 65 72 49 6e 63 68 |.."/cell|sPerInch|
|000023c0| 20 70 69 78 65 6c 73 50 | 65 72 49 6e 63 68 20 25 | pixelsP|erInch %|
|000023d0| 2e 32 66 20 64 69 76 20 | 64 65 66 09 25 25 20 68 |.2f div |def.%% h|
|000023e0| 61 6c 66 74 6f 6e 65 20 | 64 6f 74 20 66 72 65 71 |alftone |dot freq|
|000023f0| 75 65 6e 63 79 5c 6e 22 | 0d 09 09 09 2c 73 71 72 |uency\n"|....,sqr|
|00002400| 74 28 67 72 61 79 4c 65 | 76 65 6c 73 2d 31 29 29 |t(grayLe|vels-1))|
|00002410| 3b 0d 09 09 66 70 72 69 | 6e 74 66 28 66 69 6c 65 |;...fpri|ntf(file|
|00002420| 2c 0d 09 09 09 22 63 65 | 6c 6c 73 50 65 72 49 6e |,...."ce|llsPerIn|
|00002430| 63 68 20 63 75 72 72 65 | 6e 74 73 63 72 65 65 6e |ch curre|ntscreen|
|00002440| 20 34 20 2d 32 20 72 6f | 6c 6c 20 70 6f 70 20 33 | 4 -2 ro|ll pop 3|
|00002450| 20 31 20 72 6f 6c 6c 20 | 73 65 74 73 63 72 65 65 | 1 roll |setscree|
|00002460| 6e 5c 6e 22 29 3b 0d 09 | 7d 0d 09 66 70 72 69 6e |n\n");..|}..fprin|
|00002470| 74 66 28 66 69 6c 65 2c | 0d 09 09 22 2f 73 20 6e |tf(file,|..."/s n|
|00002480| 78 20 73 74 72 69 6e 67 | 20 64 65 66 09 09 25 25 |x string| def..%%|
|00002490| 20 73 74 72 69 6e 67 20 | 74 6f 20 68 6f 6c 64 20 | string |to hold |
|000024a0| 6f 6e 65 20 72 61 73 74 | 65 72 20 6c 69 6e 65 5c |one rast|er line\|
|000024b0| 6e 22 0d 09 09 22 6e 78 | 20 6e 79 20 38 09 09 09 |n"..."nx| ny 8...|
|000024c0| 09 09 25 25 20 64 69 6d | 65 6e 73 69 6f 6e 73 20 |..%% dim|ensions |
|000024d0| 61 6e 64 20 62 69 74 73 | 2f 70 69 78 65 6c 20 6f |and bits|/pixel o|
|000024e0| 66 20 73 6f 75 72 63 65 | 20 69 6d 61 67 65 5c 6e |f source| image\n|
|000024f0| 22 0d 09 09 22 5b 6e 78 | 20 30 20 30 20 6e 79 20 |"..."[nx| 0 0 ny |
|00002500| 6e 65 67 20 30 20 6e 79 | 5d 09 25 25 20 6d 61 70 |neg 0 ny|].%% map|
|00002510| 20 75 6e 69 74 20 73 71 | 75 61 72 65 20 74 6f 20 | unit sq|uare to |
|00002520| 50 69 78 4d 61 70 20 64 | 61 74 61 5c 6e 22 0d 09 |PixMap d|ata\n"..|
|00002530| 09 22 7b 63 75 72 72 65 | 6e 74 66 69 6c 65 20 73 |."{curre|ntfile s|
|00002540| 20 72 65 61 64 68 65 78 | 73 74 72 69 6e 67 20 70 | readhex|string p|
|00002550| 6f 70 7d 09 25 25 20 72 | 65 61 64 20 64 61 74 61 |op}.%% r|ead data|
|00002560| 5c 6e 22 0d 09 09 22 62 | 69 6e 64 09 09 09 09 09 |\n"..."b|ind.....|
|00002570| 25 25 20 73 70 65 65 64 | 20 75 70 20 72 65 61 64 |%% speed| up read|
|00002580| 69 6e 67 5c 6e 22 0d 09 | 09 22 69 6d 61 67 65 5c |ing\n"..|."image\|
|00002590| 6e 22 29 3b 0d 09 61 73 | 73 65 72 74 28 73 69 7a |n");..as|sert(siz|
|000025a0| 65 6f 66 28 2a 62 79 74 | 65 29 3d 3d 31 29 3b 09 |eof(*byt|e)==1);.|
|000025b0| 2f 2f 20 72 65 71 75 69 | 72 65 64 20 62 79 20 6f |// requi|red by o|
|000025c0| 75 72 20 61 6c 67 6f 72 | 69 74 68 6d 0d 09 61 73 |ur algor|ithm..as|
|000025d0| 73 65 72 74 28 73 69 7a | 65 6f 66 28 2a 77 6f 72 |sert(siz|eof(*wor|
|000025e0| 64 29 3d 3d 32 29 3b 09 | 2f 2f 20 72 65 71 75 69 |d)==2);.|// requi|
|000025f0| 72 65 64 20 62 79 20 6f | 75 72 20 61 6c 67 6f 72 |red by o|ur algor|
|00002600| 69 74 68 6d 0d 09 69 66 | 28 72 65 66 6c 65 63 74 |ithm..if|(reflect|
|00002610| 61 6e 63 65 3d 3d 4e 55 | 4c 4c 29 66 6f 72 28 69 |ance==NU|LL)for(i|
|00002620| 3d 30 3b 69 3c 32 35 36 | 3b 69 2b 2b 29 7b 0d 09 |=0;i<256|;i++){..|
|00002630| 09 73 70 72 69 6e 74 66 | 28 73 74 72 69 6e 67 2c |.sprintf|(string,|
|00002640| 22 25 30 32 78 22 2c 28 | 69 6e 74 29 69 29 3b 0d |"%02x",(|int)i);.|
|00002650| 09 09 68 65 78 5b 69 5d | 3d 2a 28 75 6e 73 69 67 |..hex[i]|=*(unsig|
|00002660| 6e 65 64 20 73 68 6f 72 | 74 20 2a 29 73 74 72 69 |ned shor|t *)stri|
|00002670| 6e 67 3b 0d 09 7d 65 6c | 73 65 20 66 6f 72 28 69 |ng;..}el|se for(i|
|00002680| 3d 30 3b 69 3c 32 35 36 | 3b 69 2b 2b 29 7b 0d 09 |=0;i<256|;i++){..|
|00002690| 09 69 6e 74 20 6a 3b 0d | 09 09 6a 3d 30 2e 35 2b |.int j;.|..j=0.5+|
|000026a0| 32 35 35 2a 72 65 66 6c | 65 63 74 61 6e 63 65 5b |255*refl|ectance[|
|000026b0| 69 5d 3b 0d 09 09 69 66 | 28 6a 3c 30 29 6a 3d 30 |i];...if|(j<0)j=0|
|000026c0| 3b 0d 09 09 69 66 28 6a | 3e 32 35 35 29 6a 3d 32 |;...if(j|>255)j=2|
|000026d0| 35 35 3b 0d 09 09 73 70 | 72 69 6e 74 66 28 73 74 |55;...sp|rintf(st|
|000026e0| 72 69 6e 67 2c 22 25 30 | 32 78 22 2c 6a 29 3b 0d |ring,"%0|2x",j);.|
|000026f0| 09 09 68 65 78 5b 69 5d | 3d 2a 28 75 6e 73 69 67 |..hex[i]|=*(unsig|
|00002700| 6e 65 64 20 73 68 6f 72 | 74 20 2a 29 73 74 72 69 |ned shor|t *)stri|
|00002710| 6e 67 3b 0d 09 7d 0d 09 | 77 69 64 74 68 3d 72 65 |ng;..}..|width=re|
|00002720| 63 74 50 74 72 2d 3e 72 | 69 67 68 74 2d 72 65 63 |ctPtr->r|ight-rec|
|00002730| 74 50 74 72 2d 3e 6c 65 | 66 74 3b 0d 09 62 79 74 |tPtr->le|ft;..byt|
|00002740| 65 73 3d 28 77 69 64 74 | 68 2b 31 29 2a 73 69 7a |es=(widt|h+1)*siz|
|00002750| 65 6f 66 28 2a 77 6f 72 | 64 29 3b 0d 09 62 75 66 |eof(*wor|d);..buf|
|00002760| 66 65 72 3d 28 75 6e 73 | 69 67 6e 65 64 20 73 68 |fer=(uns|igned sh|
|00002770| 6f 72 74 20 2a 29 4e 65 | 77 50 74 72 28 62 79 74 |ort *)Ne|wPtr(byt|
|00002780| 65 73 29 3b 0d 09 69 66 | 28 62 75 66 66 65 72 3d |es);..if|(buffer=|
|00002790| 3d 4e 55 4c 4c 29 50 72 | 69 6e 74 66 45 78 69 74 |=NULL)Pr|intfExit|
|000027a0| 28 22 25 73 28 25 73 29 | 3a 20 22 0d 09 09 22 6e |("%s(%s)|: "..."n|
|000027b0| 6f 20 72 6f 6f 6d 20 66 | 6f 72 20 25 6c 64 20 62 |o room f|or %ld b|
|000027c0| 79 74 65 20 62 75 66 66 | 65 72 2e 5c 6e 5c 30 30 |yte buff|er.\n\00|
|000027d0| 37 22 2c 5f 5f 46 49 4c | 45 5f 5f 2c 66 69 6c 65 |7",__FIL|E__,file|
|000027e0| 6e 61 6d 65 2c 62 79 74 | 65 73 29 3b 0d 09 62 75 |name,byt|es);..bu|
|000027f0| 66 66 65 72 33 32 3d 28 | 75 6e 73 69 67 6e 65 64 |ffer32=(|unsigned|
|00002800| 20 73 68 6f 72 74 20 2a | 29 53 74 72 69 70 41 64 | short *|)StripAd|
|00002810| 64 72 65 73 73 28 62 75 | 66 66 65 72 29 3b 0d 09 |dress(bu|ffer);..|
|00002820| 66 6f 72 28 79 3d 72 65 | 63 74 50 74 72 2d 3e 74 |for(y=re|ctPtr->t|
|00002830| 6f 70 3b 79 3c 72 65 63 | 74 50 74 72 2d 3e 62 6f |op;y<rec|tPtr->bo|
|00002840| 74 74 6f 6d 3b 79 2b 2b | 29 7b 0d 09 09 6d 6f 64 |ttom;y++|){...mod|
|00002850| 65 3d 74 72 75 65 33 32 | 62 3b 0d 09 09 69 66 28 |e=true32|b;...if(|
|00002860| 63 61 6e 33 32 29 53 77 | 61 70 4d 4d 55 4d 6f 64 |can32)Sw|apMMUMod|
|00002870| 65 28 26 6d 6f 64 65 29 | 3b 0d 09 09 62 79 74 65 |e(&mode)|;...byte|
|00002880| 3d 61 64 64 72 3b 0d 09 | 09 77 6f 72 64 3d 62 75 |=addr;..|.word=bu|
|00002890| 66 66 65 72 33 32 3b 0d | 09 09 66 6f 72 28 69 3d |ffer32;.|..for(i=|
|000028a0| 30 3b 69 3c 77 69 64 74 | 68 3b 69 2b 2b 29 20 2a |0;i<widt|h;i++) *|
|000028b0| 77 6f 72 64 2b 2b 20 3d | 20 68 65 78 5b 2a 62 79 |word++ =| hex[*by|
|000028c0| 74 65 2b 2b 5d 3b 0d 09 | 09 2a 77 6f 72 64 3d 30 |te++];..|.*word=0|
|000028d0| 3b 0d 09 09 69 66 28 63 | 61 6e 33 32 29 53 77 61 |;...if(c|an32)Swa|
|000028e0| 70 4d 4d 55 4d 6f 64 65 | 28 26 6d 6f 64 65 29 3b |pMMUMode|(&mode);|
|000028f0| 0d 09 09 66 70 72 69 6e | 74 66 28 66 69 6c 65 2c |...fprin|tf(file,|
|00002900| 22 25 73 5c 6e 22 2c 28 | 63 68 61 72 20 2a 29 62 |"%s\n",(|char *)b|
|00002910| 75 66 66 65 72 29 3b 0d | 09 09 61 64 64 72 2b 3d |uffer);.|..addr+=|
|00002920| 72 6f 77 42 79 74 65 73 | 3b 0d 09 7d 0d 09 48 53 |rowBytes|;..}..HS|
|00002930| 65 74 53 74 61 74 65 28 | 28 48 61 6e 64 6c 65 29 |etState(|(Handle)|
|00002940| 70 6d 2c 70 6d 53 74 61 | 74 65 29 3b 0d 09 44 69 |pm,pmSta|te);..Di|
|00002950| 73 70 6f 73 50 74 72 28 | 28 50 74 72 29 62 75 66 |sposPtr(|(Ptr)buf|
|00002960| 66 65 72 29 3b 0d 09 66 | 70 72 69 6e 74 66 28 66 |fer);..f|printf(f|
|00002970| 69 6c 65 2c 0d 09 09 22 | 25 25 25 25 54 72 61 69 |ile,..."|%%%%Trai|
|00002980| 6c 65 72 5c 6e 22 0d 09 | 09 22 67 72 65 73 74 6f |ler\n"..|."gresto|
|00002990| 72 65 5c 6e 22 0d 09 09 | 22 65 6e 64 5c 6e 22 0d |re\n"...|"end\n".|
|000029a0| 09 09 22 73 68 6f 77 70 | 61 67 65 5c 6e 22 0d 09 |.."showp|age\n"..|
|000029b0| 09 22 25 25 25 25 45 4f | 46 5c 6e 22 29 3b 0d 09 |."%%%%EO|F\n");..|
|000029c0| 66 63 6c 6f 73 65 28 66 | 69 6c 65 29 3b 0d 09 53 |fclose(f|ile);..S|
|000029d0| 65 74 46 69 6c 65 49 6e | 66 6f 28 66 69 6c 65 6e |etFileIn|fo(filen|
|000029e0| 61 6d 65 2c 27 54 45 58 | 54 27 2c 43 52 45 41 54 |ame,'TEX|T',CREAT|
|000029f0| 4f 52 29 3b 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 |OR);.}..|........|
|00002a00| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00002a10| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002a20| 31 30 31 30 31 30 31 66 | 65 66 65 66 65 66 65 66 |1010101f|efefefef|
|00002a30| 0d 57 69 6e 64 6f 77 54 | 6f 45 50 53 2e 63 02 00 |.WindowT|oEPS.c..|
|00002a40| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002a50| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a70| 00 00 ab bf ee 75 00 00 | 00 00 00 00 01 9a 31 30 |.....u..|......10|
|00002a80| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002a90| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002aa0| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002ab0| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002ac0| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002ad0| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002ae0| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002af0| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 30 31 30 |10101010|10101010|
|00002b00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b20| 00 00 00 00 00 00 00 03 | 00 04 00 62 00 0e 01 83 |........|...b....|
|00002b30| 02 6d 00 62 00 0e 01 83 | 02 6d ab 94 8c bc 00 00 |.m.b....|.m......|
|00002b40| 16 3d 00 00 16 3d 00 00 | 13 a2 00 00 00 00 00 04 |.=...=..|........|
|00002b50| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00002b60| 00 00 00 46 00 71 4c 48 | 2a 9a 00 00 00 1c 00 46 |...F.qLH|*......F|
|00002b70| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00002b80| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00002b90| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00002ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+